﻿using LJ.Host.Web.Extensions;
using LJ.Test.Host.Abstractions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Reflection.PortableExecutable;
using Xunit.Abstractions;

namespace LJ.Test.Host.Web;

/// <summary>
/// 测试配置启动项
/// </summary>
/// <param name="messageSink"></param>
public class WebHostTestFramework(IMessageSink messageSink) : HostTestFrameworkBase(messageSink)
{
    public override IHost CreateHost()
    {

        var builder = WebApplication.CreateBuilder();

        builder.Services.AddLJ(builder.Configuration);
        builder.WebHost.UseTestServer();
        var app = builder.Build();

        app.UseLJ();
        return app;
    }

   
}